new Vue({
    el: '#app',
    data: {
        adTime: '',
        leaTime: '',
        shock: '',
        shockDetail: '',
        draft: '',
        draftDetail: '',
        CURBScore: '',
        SOFAScore: '',
        project: '',
        blood: '',
        useDay: '',
        others: '',
        options : [{
		    label: '否',
		    value: 'no'
			},
			{
		    label: '是(如是请填写)',
		    value: 'yes'
			},
        ]
    },
    methods: {
        goto() {
            if (this.adTime == '') {
                this.$toast('请选择入院时间')
            } else if (this.leaTime == '') {
                this.$toast('请选择出院时间')
            } else if (this.adTime >= this.leaTime) {
                this.$toast('出入院时间选择有误')
            } else if (this.shock == '') {
                this.$toast('请选择是否感染休克')
            } 
            else if (this.draft == '') {
                this.$toast('请选择是否需要机械通')
            } else if (this.CURBScore == '') {
                this.$toast('请填写CURB-65评分')
            } else if (this.SOFAScore == '') {
                this.$toast('请填写SOFA评分')
            } else if (this.project == '') {
                this.$toast('请填写详细治疗方案')
            } else if (this.blood == '') {
                this.$toast('请填写血必净使用量')
            } else if (this.useDay == '') {
                this.$toast('请填写血必净使用天数')
            } else if (this.others == '') {
                this.$toast('请填写其他联合使用药物')
            } else {
                localStorage.setItem("secondIndex",2)
                window.location.href = "perHistory.html"
            }
        }
    },
    updated() {
        if (this.shock == 'no'){
             this.$refs.sDetail.value='';
        this.$refs.sDetail.disabled = true
        }
        else if(this.shock=='yes'){
            this.$refs.sDetail.disabled = false
            if(this.shockDetail==''){
                this.$toast('请填写感染休克详细')
            }
        }
        if(this.draft=='no'){
            this.$refs.draDetail.value='';
        this.$refs.draDetail.disabled = true
        }
        
        else if(this.draft=='yes'){
            this.$refs.draDetail.disabled = false
            if(this.draftDetail==''){
                this.$toast('请填写机械通详细')
            }
        }
       
    },
})